﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Delonix_Regia_Hotel_Management_System.Classes;

namespace Delonix_Regia_Hotel_Management_System
{
    public partial class StaffMainPage : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                if (Session["user"] == null)
                {
                    Response.Redirect("LoginPage.aspx");
                }
            }

            HotelUser user = (HotelUser)Session["user"];
            if (user.Rank == "Staff")
            {
                btnCreate.Visible = false;
                btnRetrieve.Visible = true;
                btnUpdate.Visible = true;
                btnDelete.Visible = false;
            }
            else if (user.Rank == "Admin")
            {
                btnCreate.Visible = true;
                btnRetrieve.Visible = true;
                btnUpdate.Visible = true;
                btnDelete.Visible = true;
            }

        }

        protected void btnLogo_Click(object sender, ImageClickEventArgs e)
        {
            Response.Redirect("WelcomePage.aspx");
        }

        protected void btnAdmin_Click(object sender, ImageClickEventArgs e)
        {
            Response.Redirect("AdminMainPage.aspx");
        }

        protected void btnCheckIn_Click(object sender, ImageClickEventArgs e)
        {
            Response.Redirect("CheckInPage.aspx");
        }

        protected void btnCheckOut_Click(object sender, ImageClickEventArgs e)
        {
            Response.Redirect("CheckOutPage.aspx");
        }

        protected void btnQuery_Click(object sender, ImageClickEventArgs e)
        {
            Response.Redirect("QueryPage.aspx");
        }

        protected void btnBooking_Click(object sender, ImageClickEventArgs e)
        {
            Response.Redirect("RoomAvailabilityPage.aspx");
        }

        protected void btnRates_Click(object sender, ImageClickEventArgs e)
        {
            Response.Redirect("RatesPage.aspx");
        }

        protected void btnStaff_Click(object sender, ImageClickEventArgs e)
        {
            Response.Redirect("StaffMainPage.aspx");
        }

        protected void btnReport_Click(object sender, ImageClickEventArgs e)
        {
            Response.Redirect("ReportPage.aspx");
        }

        protected void btnLogout_Click(object sender, ImageClickEventArgs e)
        {
            Session["user"] = null;
            Response.Redirect("LoginPage.aspx");
        }

        protected void btnCreate_Click(object sender, EventArgs e)
        {
            Response.Redirect("CreateStaffPage.aspx");
        }

        protected void btnRetrieve_Click(object sender, EventArgs e)
        {
            Response.Redirect("RetrieveStaffPage.aspx");
        }

        protected void btnUpdate_Click(object sender, EventArgs e)
        {
            Response.Redirect("UpdateStaffPage.aspx");
        }

        protected void btnDelete_Click(object sender, EventArgs e)
        {
            Response.Redirect("DeleteStaffPage.aspx");
        }

        protected void btnBackup_Click(object sender, EventArgs e)
        {
            Response.Redirect("DatabaseBackupPage.aspx");
        }
    }
}
